<template>
  <el-config-provider :z-index="1000" size="default">
    <router-view />
  </el-config-provider>
</template>
<script setup lang="ts">
import { onBeforeMount } from 'vue';
import moment from 'moment';
import { useBaseDataStore } from '@/store/index';
import { getToken } from "@/api/energyapi";
const baseDataStore = useBaseDataStore();
moment.locale('zh-cn')
// import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// interface State {
//   /** 数据状态 */
//   loading: boolean;
//   /** 本地化 */
//   locale: boolean;
// }

/** 数据 */
// let state = ref<State>({
//   loading: false,
//   locale: zhCn,
// });
/** 生命周期 */
onBeforeMount(() => {
  if(!baseDataStore.getBaseData('token')){
    getToken('').then((res: any)=>{
      const token = res?.data?.data;
      baseDataStore.setBaseDataApi({ key: "token", value: token });
    });
  }
//   [
//     '/publicData/images/favicon.ico',
//     '/publicData/font/font.css',
//     // '/publicData/styles/elementPlus/index.css',
//     '/publicData/styles/hedou/index.css',
//     // "/publicData/styles/theme/index.css",
//     '/publicData/styles/theme.css',
//   ].forEach((item) => {
//     if (item.endsWith('.css')) {
//       const link = document.createElement('link');
//       link.rel = 'stylesheet';
//       link.href = item;
//       document.head.appendChild(link);
//     }
//     if (item.endsWith('.ico')) {
//       const link = document.createElement('link');
//       link.rel = 'icon';
//       link.href = item;
//       document.head.appendChild(link);
//     }
//   });
});
/** 方法 */
/** 监听 */
/** 计算属性 */
</script>
<style lang="scss">
#app {
  font-family: 'SourceHanSansCN-Normal', 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #fff;
  font-size: 14px;
}

body,
html {
  margin: 0;
  padding: 0;
}
div:v-deep(.hedou-picker-panel,.hedou-date-picker){
  background:#00274d;
}

</style>
